package com.sunshine.wrongquestionset.activity.splash

import android.app.Application

import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData

import com.sunshine.wrongquestionset.room.repository.MyRepository

/**
 * @author sunshine
 * @date 2021/3/27
 */
class SplashViewModel(application: Application): AndroidViewModel(application) {
    private val repository: MyRepository = MyRepository(application.applicationContext)

    /**
     * 获取登录用户的信息
     * @return 登录用户id，没有登录用户返回null。当然这里是LiveData
     */
    fun hasLoginUser(): LiveData<String?>{
        return repository.getLoginUserId()
    }

}